//
//  CustomView.m
//  Help
//
//  Created by 安徽永东网络科技有限公司 on 2019/11/26.
//  Copyright © 2019 路. All rights reserved.
//

#import "CustomView.h"
#import "UIImage+GIF.h"

@implementation CustomView

- (CGSize)intrinsicContentSize {
    CGFloat contentViewH = 80;
    CGFloat contentViewW = 80;
    return CGSizeMake(contentViewW, contentViewH);
}

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self addContentView];
        self.translatesAutoresizingMaskIntoConstraints = NO;
    }
    return self;
}

-(void)addContentView{
    NSString *path = [[NSBundle mainBundle] pathForResource:@"luyin" ofType:@"gif"];
    NSData *data = [NSData dataWithContentsOfFile:path];
    UIImage *image = [UIImage sd_imageWithGIFData:data];
    UIImageView *cusImageV = [[UIImageView alloc] initWithImage:image];
    cusImageV.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
    [self addSubview:cusImageV];
}
@end
